/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.univcasa.view.forms;

import java.util.Date;
import javax.servlet.http.HttpServletRequest;

import org.apache.struts.action.ActionErrors;
import org.apache.struts.action.ActionMapping;
import org.apache.struts.action.ActionMessage;

/**
 *
 * @author issam
 */
public class ajoutDBCompteStdForm extends org.apache.struts.action.ActionForm {

    private String cne;
    private String apogee;
    private String cin;
    private String nom;
    private String prenom;
    private String sexe;
    private String naissance;
    private String etab;
    private String diplome;
    private String etape;

    /**
     *
     */
    public ajoutDBCompteStdForm() {
        super();
        // TODO Auto-generated constructor stub
    }

    public String getApogee() {
        return apogee;
    }

    public void setApogee(String apogee) {
        this.apogee = apogee;
    }

    public String getCin() {
        return cin;
    }

    public void setCin(String cin) {
        this.cin = cin;
    }

    public String getCne() {
        return cne;
    }

    public void setCne(String cne) {
        this.cne = cne;
    }

    public String getDiplome() {
        return diplome;
    }

    public void setDiplome(String diplome) {
        this.diplome = diplome;
    }

    public String getEtab() {
        return etab;
    }

    public void setEtab(String etab) {
        this.etab = etab;
    }

    public String getEtape() {
        return etape;
    }

    public void setEtape(String etape) {
        this.etape = etape;
    }

    public String getNaissance() {
        return naissance;
    }

    public void setNaissance(String naissance) {
        this.naissance = naissance;
    }

    public String getNom() {
        return nom;
    }

    public void setNom(String nom) {
        this.nom = nom;
    }

    public String getPrenom() {
        return prenom;
    }

    public void setPrenom(String prenom) {
        this.prenom = prenom;
    }

    public String getSexe() {
        return sexe;
    }

    public void setSexe(String sexe) {
        this.sexe = sexe;
    }

    

    /**
     * This is the action called from the Struts framework.
     * @param mapping The ActionMapping used to select this instance.
     * @param request The HTTP Request we are processing.
     * @return
     */
    public ActionErrors validate(ActionMapping mapping, HttpServletRequest request) {
        ActionErrors errors = new ActionErrors();
        if (getNom() == null || getNom().length() < 1) {
            errors.add("name", new ActionMessage("error.name.required"));
        }
        if (getPrenom() == null || getPrenom().length() < 1) {
            errors.add("name", new ActionMessage("error.name.required"));
        }
        if (getCin() == null || getCin().length() < 1) {
            errors.add("name", new ActionMessage("error.name.required"));
        }
        if (getCne() == null || getCne().length() < 1) {
            errors.add("name", new ActionMessage("error.name.required"));
        }
        if (getEtab() == null || getEtab().length() < 1) {
            errors.add("name", new ActionMessage("error.name.required"));
        }
        if (getNaissance() == null || getNaissance().length() < 1) {
            errors.add("name", new ActionMessage("error.name.required"));
        }
        return errors;
    }
}
